package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.ZyUnit;
import com.blb.community_admin.mapper.ZyUnitMapper;
import com.blb.community_admin.service.IZyUnitService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ZyUnitServiceImpl extends ServiceImpl<ZyUnitMapper, ZyUnit> implements IZyUnitService {

    @Resource
    private ZyUnitMapper zyUnitMapper;

    @Override
    public List<ZyUnit> selectUnit(String buildingName) {
        return zyUnitMapper.selectUnit(buildingName);
    }

    /**
     * 分页查询
     * @param current
     * @param size
     * @return
     */
    @Override
    public IPage<ZyUnit> selectUnitPage(Long current, Long size) {
        return zyUnitMapper.selectUnitPage(new Page<ZyUnit>(current,size));
    }

    @Override
    public IPage<ZyUnit> fuzzyPage(Long current, Long size, String unitName, String unitCode, String buildingName) {
        return zyUnitMapper.fuzzyPage(new Page<ZyUnit>(current,size),unitName,unitCode,buildingName);
    }
}
